Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Graphics /
Chapter 2 - Geometric Shapes / Geometric Shapes Reference
Functions / Editing Shape Geometries


GXSetPathParts

You can use the GXSetPathParts function to replace a range of geometric points in the geometry of a path shape with the information from a specified gxPaths structure.

void GXSetPathParts(gxShape target, long index, long count, 
                    const gxPaths *data, gxEditShapeFlag flags);
target
A reference to the path shape whose geometry you want to edit.
index
The index number of the first geometric point to replace. A value of 0 indicates that the new information should be inserted after the final geometric point in the target shape's geometry.
count
The number of the geometric points to replace. A value of 0 indicates that no geometric points should be replaced; instead, the new information is inserted before the geometric point specified by the index parameter. If you pass the gxSelectToEnd constant for this parameter, all geometric points from the one specified by the index parameter to the final geometric point are replaced.
data
A pointer to the gxPaths structure containing the new geometry information.
flags
A set of flags that determine how the new information is inserted in the existing geometry.
DESCRIPTION
The GXSetPathParts function replaces geometry information in the target shape's geometry with the information pointed to by the data parameter. The index and count parameters determine what part of the original geometry is replaced. The flags parameter determines how the new information is inserted in the geometry.

The data parameter contains a pointer to the geometry information to be copied into the target shape's geometry. If you pass the gxSetToNil constant for this parameter, no new information is copied in; in this case, the GXSetPathParts function removes the indicated geometric points instead of replacing them.

The index parameter indicates the first geometric point to be replaced. If you pass a value of 0 for this parameter, no geometric points are replaced. Instead, this function inserts the new geometric information after the last geometric point of the target shape's original geometry. If you pass 0 for this parameter, you must pass 0 or the gxSelectToEnd constant for the count parameter.

The count parameter indicates how many geometric points in the original geometry should be replaced. If you pass a value of 0 for this parameter, no geometric points are replaced; instead, this function inserts the new geometry information before the geometric point indicated by the index parameter. If you pass the gxSelectToEnd constant for this parameter, the function replaces all geometric points in the original geometry starting with the one indicated by the index parameter.

When this function inserts the new geometric information, it retains the contour breaks contained in the gxPaths structure specified in the data parameter. For example, if you provide a gxPaths structure that contains two contours, the break between those contours remains when the geometric points are inserted into the target shape's geometry.

The flags parameter indicates how you want the function to merge the first geometric point and the last geometric point of the gxPaths structure into the target shape's geometry. The possible flags are

gxBreakNeitherEdit         = 0
gxBreakLeftEdit            = 0x01
gxBreakRightEdit           = 0x02
gxRemoveDuplicatePoints    = 0x04
The gxBreakNeitherEdit value indicates that the first geometric point of the gxPaths structure should be merged into the preceding contour of the target shape's geometry and the final geometric point of the gxPaths structure should be merged into the subsequent contour.

The gxBreakLeftEdit flag indicates that the first geometric point of the gxPaths structure should begin a new contour once inserted in the target shape's geometry. The gxBreakRightEdit flag indicates that the geometric point in the target shape that follows the final geometric point of the gxPaths structure (after the new information is inserted) should begin a new contour.

The gxRemoveDuplicatePoints flag indicates that this function should, when inserting the information from the gxPaths structure, remove the first geometric point of this inserted structure if it exactly matches the preceding point in the existing geometry. Similarly, this flag indicates that the final geometric point of the gxPaths structure should be removed if it exactly matches the subsequent geometric point in the target shape's geometry.

ERRORS, WARNINGS, AND NOTICES
Errors 
out_of_memory 
shape_is_nil 
number_of_points_exceeds_implementation_limit 
number_of_contours_exceeds_implementation_limit 
size_of_polygon_exceeds_implementation_limit 
illegal_type_for_shape(debugging version)
inconsistent_parameters(debugging version)
index_is_less_than_zero(debugging version)
count_is_less_than_zero(debugging version)
shape_access_not_allowed(debugging version)
Warnings 
index_out_of_range 
count_out_of_range 
SEE ALSO
For an example that uses this function, see "Editing Paths Parts" beginning on page 2-91.

For a discussion of paths, see "Path Shapes" on page 2-25.

For the definition of the gxPaths structure, see "Path Structures" on page 2-107.

For information about other functions that allow you to edit information in shape geometries, see the description of the GXSetShapePoints function on page 2-142 and the description of the GXSetShapeParts function on page 2-154.

To copy parts of a path shape's geometry, use the GXGetPathParts function, which is described on page 2-148.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help